<fieldset style="width:1065px;border:solid 1px #A4BED4;margin-bottom:10px;margin-top:10px;margin-left:-1px;position:relative;">
    <legend><strong style="font-size: 18px;">重置密码</strong></legend>
    <form action="/oa/setpassword" method="post" enctype="multipart/form-data" id="passSubmit">
        <div>
            <input type="hidden" name="id" id="ClickRowID" value="<?=$staff['cid']?>">
            <table style="width:250px;table-layout:fixed;">
                <tbody>
                <tr>
                    <td style="width:70px; text-align: right;">原始密码：</td>
                    <td style="width:160px;">
                        <input name="opass" type="password" style="width: 150px;" value="<?=$staff['name']?>" class="text required" id="opass" required="true">
                    </td>
                </tr>
                <tr>
                    <td style="width:70px;text-align: right;">新密码：</td>
                    <td style="width:160px;">
                        <input name="npass" type="password" style="width: 150px;" value="<?=$staff['name']?>" class="text required" id="npass" required="true">
                    </td>
                </tr>
                <tr>
                    <td style="width:70px;text-align: right;">确认密码：</td>
                    <td style="width:160px;">
                        <input name="cnpass" type="password" style="width: 150px;"  class="text required" id="cnpass" required="true">
                    </td>
                </tr>
                <tr><td colspan="2">&nbsp;</td></tr>
                <tr>
                    <td>&nbsp;</td>
                    <td >
                        <a href="javascript:void(0)" class="button" id="SaveButton">
                            <span class="button-text">修改</span></a>&nbsp;&nbsp;
                        <a href="javascript:void(0)" class="button" id="ResetButton">
                            <span class="button-text">重置</span>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </form>
</fieldset>

<script type="text/javascript">
    $(document).ready(function(){

        // 变更提交
        $('a#SaveButton').click(function(){
            // 数据检测
            if ($("#opass").val() == '' || $("#npass").val() == '') {
                parent.$.dooDialog.alert('原始密码和新密码必须填写！');
                return false;
            } else {
                if ($("#npass").val() != $("#cnpass").val()) {
                    parent.$.dooDialog.alert('确认密码和新密码必须填写一致！');
                    return false;
                }
                $.post($('form#passSubmit').attr('action'),$('form#passSubmit').serializeArray(),function(data){
                    if(data.err == 0){
                        $('input.text,input.number,input.count').each(function(){
                            $(this).val('');
                        });
                        parent.$.dooDialog.alert(data.msg);
                        return true;
                    }else{
                        parent.$.dooDialog.alert(data.msg);
                        return false;
                    }
                },'json');
            }
        });

        // 重置
        $('a#ResetButton').click(function(){
            $('input[name="opass"]').val('');
            $('input[name="npass"]').val('');
        });
    });
</script>